import { createBrowserHistory as createHistory } from 'history';

export const History = createHistory({ basename: __BASE_NAME__ });

export const linkTo = link => {
  /**
   * 跳转页面
   */
  History.push(link);
};
export const replaceLink = link => {
  /**
   * 刷新当前页
   */
  History.replace(link);
};
export const goBack = () => {
  /**
   * 返回上一页
   */
  History.goBack();
};
export const toLink = link => {
  /**
   * 跳转页面
   */
  window.location.href = link;
};
export const openLink = link => {
  /**
   * 打开新页面
   */
  window.open(link);
};
